home *** CD-ROM | disk | FTP | other *** search
- /* MapKey
- Programmation d'une séquence de touches
- Version 1.00: 18 juillet 2001
- Version 1.01: 1er décembre 2001 (German localization by A. Greve)
- $VER: MapKey.AmiPCB 1.01 (® R.Florac, 1/12/2001) */
-
- options results /* indispensable pour récupérer le résultat des macros */
-
- signal on error /* pour l'interception des erreurs */
- signal on syntax
-
- lf ='0a'x
-
- fr = 'ARexx/InitVars.AmiPCB'()
-
- 'VERSION'
- if result < 1.04 then do
- select
- when fr=1 then 'MESSAGE("Ce script nécessite'lf'AmiPCB version 1.04'lf'ou plus")'
- when fr=2 then 'MESSAGE("Dieses Skript benötigt'lf'AmiPCB Version 1.04+")'
- otherwise 'MESSAGE("This script needs'lf'AmiPCB version 1.04+")'
- end
- exit
- end
-
- keys=getclip(key_sequence)
- if key~="" then keys=doublage_guillemets(keys)
- select
- when fr=1 then 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Séquence de touches'lf'à programmer ?'lf'Ex: shift-alt-f","'keys'")'
- when fr=2 then 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Zu programmierende'lf'Tasten-Sequenz ?'lf'Bsp: shift-alt-f","'keys'")'
- otherwise 'INIT(KEY_SEQ,KEY_MACRO):KEY_SEQ=ASKTEXT("Keys sequence'lf'to program ?'lf'Ex: shift-alt-f","'keys'")'
- end
- key=result
- if key~="" then do
- setclip(key_sequence,key)
- select
- when fr=1 then 'KEY_MACRO=ASKTEXT("Macro associée à "+KEY_SEQ,READMAP(KEY_SEQ))'
- when fr=2 then 'KEY_MACRO=ASKTEXT("Zugeordnetes Makro für "+KEY_SEQ,READMAP(KEY_SEQ))'
- otherwise 'KEY_MACRO=ASKTEXT("Associated macro for "+KEY_SEQ,READMAP(KEY_SEQ))'
- end
- if result~="" then 'MAP(KEY_SEQ,KEY_MACRO)'
- end
-
- exit
-
- doublage_guillemets: procedure
- parse arg chaine
- t=''
- do i=1 to length(chaine)
- c = substr(chaine,i,1)
- if c='"' then c=c||'"'
- t=t||c
- end
- return t
-
- /* Traitement des erreurs, interruption du programme */
- syntax:
- erreur=RC
- Call 'ARexx/_Syntax.rexx'(fr,'MapKey.AmiPCB',SIGL,erreur)
- exit
-
- error:
- Call 'ARexx/_Error.rexx'(fr,'MapKey.AmiPCB',SIGL)
- exit
-